package com.xue;

import cn.hutool.core.util.StrUtil;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author xuejingbao
 * @create 2023-10-10 17:14
 */
public class Main {


    public static void main(String[] args) throws InterruptedException, IOException {
        Config.INSTANCE.loadConfig(args);
        GpsForPi instance = GpsForPi.getInstance();
        instance.init("/dev/serial0");
        instance.addListener(msg -> {
            String msgStr = new String(msg, StandardCharsets.UTF_8);
            System.out.println("received gps:" + msgStr);
        });
        MqttLocation.getInstance().testSend();
    }

}
